//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include "crt0.h"
#include <elastos.h>

EXTERN_C int wmain(int argc, wchar_t *wargv[])
{
    int i;
    CarQuintet argv;

    for (i = 0; i < argc; i++) {
        argv.m_used = 1;
        argv.m_size = _WString_GetLength(wargv[i], -1) * 4 + 1;
        argv.m_pBuf = (char *)_alloca(argv.m_size);
#if defined(_linux)
        _AStringBuf_Append_WString(&argv, wargv[i], -1, Encoding_UTF8);
#else
        _AStringBuf_Append_WString(&argv, wargv[i], -1, Encoding_Default);
#endif
        wargv[i] = (wchar_t *)argv.m_pBuf;
    }

    return main(argc, (char **)wargv);
}
